package cn.wsw.hrm.controller;

import cn.wsw.hrm.service.ImageValidateCodeService;
import cn.wsw.hrm.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/validate")
public class ImageValidateCodeController {

    @Autowired
    private ImageValidateCodeService service;
    /**
     *  图片验证码
     * @param imageCodeKey
     * @return 返回一个base64加密后的值
     */
    @GetMapping("/code/{imageCodeKey}")
    public String getCode(@PathVariable("imageCodeKey") String imageCodeKey){
        return service.getCode(imageCodeKey);
    }
    /**
     * 短信验证码
     */
    @GetMapping("/sendSmsCode")
    public AjaxResult sendCode(@RequestBody Map<String,String> param){
        return service.sendSmsCode(param);

    }
}
